.class Lcom/waiqin365/lightapp/im/adapter/bs;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/view/View$OnClickListener;


# instance fields
.field final synthetic a:Ljava/lang/String;

.field final synthetic b:Lcom/hyphenate/chat/EMNormalFileMessageBody;

.field final synthetic c:Lcom/hyphenate/chat/EMMessage;

.field final synthetic d:Lcom/waiqin365/lightapp/im/adapter/bk;


# direct methods
.method constructor <init>(Lcom/waiqin365/lightapp/im/adapter/bk;Ljava/lang/String;Lcom/hyphenate/chat/EMNormalFileMessageBody;Lcom/hyphenate/chat/EMMessage;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    iput-object p2, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->a:Ljava/lang/String;

    iput-object p3, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->b:Lcom/hyphenate/chat/EMNormalFileMessageBody;

    iput-object p4, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 4

    new-instance v1, Ljava/io/File;

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->a:Ljava/lang/String;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    if-eqz v1, :cond_1

    invoke-virtual {v1}, Ljava/io/File;->exists()Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/adapter/bk;->b(Lcom/waiqin365/lightapp/im/adapter/bk;)Landroid/content/Context;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    invoke-static {v1, v0}, Lcom/hyphenate/util/FileUtils;->openFile(Ljava/io/File;Landroid/app/Activity;)V

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->direct()Lcom/hyphenate/chat/EMMessage$Direct;

    move-result-object v0

    sget-object v1, Lcom/hyphenate/chat/EMMessage$Direct;->RECEIVE:Lcom/hyphenate/chat/EMMessage$Direct;

    if-ne v0, v1, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMMessage;->isAcked()Z

    move-result v0

    if-nez v0, :cond_0

    :try_start_0
    invoke-static {}, Lcom/hyphenate/chat/EMClient;->getInstance()Lcom/hyphenate/chat/EMClient;

    move-result-object v0

    invoke-virtual {v0}, Lcom/hyphenate/chat/EMClient;->chatManager()Lcom/hyphenate/chat/EMChatManager;

    move-result-object v0

    iget-object v1, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v1}, Lcom/hyphenate/chat/EMMessage;->getFrom()Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    invoke-virtual {v2}, Lcom/hyphenate/chat/EMMessage;->getMsgId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/hyphenate/chat/EMChatManager;->ackMessageRead(Ljava/lang/String;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->c:Lcom/hyphenate/chat/EMMessage;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/hyphenate/chat/EMMessage;->setAcked(Z)V
    :try_end_0
    .catch Lcom/hyphenate/exceptions/HyphenateException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_1
    return-void

    :cond_1
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/adapter/bk;->b(Lcom/waiqin365/lightapp/im/adapter/bk;)Landroid/content/Context;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/im/activity/ChatActivity;

    const/4 v1, 0x0

    iput-boolean v1, v0, Lcom/waiqin365/lightapp/im/activity/ChatActivity;->e:Z

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/adapter/bk;->b(Lcom/waiqin365/lightapp/im/adapter/bk;)Landroid/content/Context;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    iget-object v2, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    invoke-static {v2}, Lcom/waiqin365/lightapp/im/adapter/bk;->b(Lcom/waiqin365/lightapp/im/adapter/bk;)Landroid/content/Context;

    move-result-object v2

    const-class v3, Lcom/waiqin365/lightapp/im/activity/ShowNormalFileActivity;

    invoke-direct {v1, v2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string/jumbo v2, "msgbody"

    iget-object v3, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->b:Lcom/hyphenate/chat/EMNormalFileMessageBody;

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bs;->d:Lcom/waiqin365/lightapp/im/adapter/bk;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/adapter/bk;->b(Lcom/waiqin365/lightapp/im/adapter/bk;)Landroid/content/Context;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    const v1, 0x7f040022

    const v2, 0x7f040021

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->overridePendingTransition(II)V

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lcom/hyphenate/exceptions/HyphenateException;->printStackTrace()V

    goto :goto_1
.end method
